<template>
	<view class="wdh-100 columnbox content">
		<view class="rowbox wdh-100 spb als one-goods" v-for="(item,index) in list" :key='index'>
			<image :src="item.medicinelogo.split(',')[0]" mode="aspectFill" class="goods-img"></image>
			<view class="columnbox als goods-info">
				<view class="type-name rowbox wdh-100 spb">
					<view style="width: 350rpx;" class="textovflow">
						{{item.medicinename}}
					</view>
					<view style="width: 140rpx;" v-if="item.kdstate>2">
						<u-button @click="showExpress(item.id)" size="mini" class="wdh-100"
							color="#00b6b2">查看物流</u-button>
					</view>
				</view>
				<view class="changjia wdh-100 textovflow">{{item.pharmacyname}} </view>
				<!-- <view class="changjia">x {{item.num}}{{item.kynuit}} </view> -->
				<view class="goods-num wdh-100 rowbox spb">
					<view>x {{item.num}}{{item.kynuit}}</view>
					<view>
						<text v-if="item.kdstate==0">未发货</text>
						<text v-else-if="item.kdstate==1">在途中</text>
						<text v-else-if="item.kdstate==2">派件中</text>
						<text v-else-if="item.kdstate==3">已签收</text>
						<text v-else-if="item.kdstate==4">派送失败</text>
						<text v-else-if="item.kdstate==5">揽收</text>
						<text v-else-if="item.kdstate==6">退回</text>
						<text v-else-if="item.kdstate==7">转单</text>
						<text v-else-if="item.kdstate==8">疑难</text>
						<text v-else-if="item.kdstate==9">退签</text>
						<text v-else-if="item.kdstate==10">待清关</text>
						<text v-else-if="item.kdstate==11">清关中</text>
						<text v-else-if="item.kdstate==12">已清关</text>
						<text v-else-if="item.kdstate==13">清关异常</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				list: []
			};
		},
		onLoad(options) {
			this.id = options.id * 1
			this.getDetail()
		},
		methods: {
			getDetail() {
				this.$req.post('/user/prescriptionxydrugs', {
					id: this.id
				}).then(res => {
					this.list = res.data.data
				})
			},
			showExpress(id) {
				uni.navigateTo({
					url: '/packageA/expres/expres?id=' + id+'&state=3'
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	.content {
		font-family: PingFang, PingFang SC;
	}

	.top-box {
		width: 100%;
		font-size: 28rpx;
		padding: 20rpx 20rpx;
		box-sizing: border-box;
		color: #5d5e5e;
		border-bottom: #f7f7fb solid 10rpx;
	}

	.one-goods {
		padding: 32rpx 32rpx;
		border-bottom: #f1f1f1 solid 1px;

		.sel-icon {
			width: 40rpx;
			height: 40rpx;
			margin-top: 50rpx;
		}

		.goods-img {
			width: 120rpx;
			height: 120rpx;
			border-radius: 10rpx;
		}

		.goods-info {
			width: calc(100% - 190rpx);
			font-size: 28rpx;
		}

		.changjia {
			font-size: 24rpx;
			line-height: 40rpx;
			color: #9d9fa1;
		}

		.price {
			font-size: 32rpx;
			color: #fc1f10;
			font-weight: bold;
		}

		.add-box,
		.add-box-minus {
			width: 50rpx;
			height: 50rpx;
			border-radius: 10rpx;
		}

		.add-box-minus {
			border: #00b6b2 solid 1px;
			background: #fff;
		}

		.goods-num {
			font-size: 28rpx;
			text-align: left;
		}
	}

	.submit-box {
		position: fixed;
		bottom: 0;
		background: #fff;
		padding: 20rpx 40rpx;
		border-top: #f1f1f1 solid 1px;
		padding-bottom: 40rpx;
	}

	.totalPrice {
		font-size: 28rpx;

		text {
			margin-left: 20rpx;
			font-size: 40rpx;
			color: #ff2917;
			font-weight: bold;
		}
	}

	.submit-btn {
		border-radius: 10rpx;
		width: 300rpx;
		height: 90rpx;
		color: #fff;
		font-size: 28rpx;
	}
</style>